package com.katus.tileserver.controller;

import com.katus.tileserver.bean.Result;
import com.katus.tileserver.dao.BaseMapDao;
import com.katus.tileserver.dao.UserDao;
import com.katus.tileserver.entity.BaseMap;
import com.katus.tileserver.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;
import java.util.List;

@Slf4j
@CrossOrigin
@RestController
@RequestMapping("/basemap")
public class BaseMapController {

    @Autowired
    BaseMapDao baseMapDao;

    @RequestMapping(value = "/list", method = RequestMethod.GET)
    @ResponseBody
    public Result getBaseMaps() {
        try {
            List<BaseMap> tmp = baseMapDao.getBaseMaps();
            return Result.success().setBody(tmp);
        } catch (Exception e) {
            return Result.error().setMessage("列表获取失败：" + e.getMessage());
        }
    }


}
